added modified cpp files from tutorial