finally kind of learned how to write c++ classes