Updated .h and .cpp files with fixed errors