initial implementation all tests passing