some code cleanup, added in Shawn's code to the final report. Have not tested compilation of the project report after updates.