implemented lots of core functionality and added several unit tests