Completed and tested assignment 2