all functions implemented with tests
janky error reporting
npm test working