Adapting the code to the test