initial implementation with basic tests