Fully working project2, with comments