all functionality implemented, all but one test passing