Issue 7: Pulled functions out into a header and .cpp files to make a library. Functionality
should not have been changed at all.