Do you have any specific questions about the code you are trying to write?
What have you written so far?