partial implementation + tests