Final code for Project 2