Fixed bug in project1a cpp code