1: Please dont double post
2: Please use [CODE] tags so its easier to read your code
3: From looking at your code it seems that you don't understand how basic things such as functions, if statements, or general flow control work. I recommend brushing up on these things before you attempt to do your assignment.