implemented all functionality, currently untested