@Jamii,
When you submit this homework and post in this forum be sure to reference the sources of code.
You used some of this code in your homework assignment:
:)