cleaned up code for handin