Code for Project 3 and onwards