code with tests