modified the implementation of a function with tests still passing