added cpp files and completed class functions