initial implementation with fixed tests