initial implementation with core tests passing