read & write files? Think logically, slowly and in simple instructions. Then its simple. The more procedure to treat information the better. Oh, and dont forget the else statement in case you find data you did not expect and that sometimes its good for the program to say 'error' than hang forever that really is all theory to that bit ahead of time.