You will increase the probability of receiving a meaningful answer if you ask one question at a time (posting the question outside the code you posted). I say this because I honestly don't know at what step you are stuck, and thus what advice to give.