add tests
fix spills