Cleaned up code for project 2