Completed code for Assingment 1. Ready for testing.