Code for project2