final version of code for project