working code and tests
working code and tests