Fix the code to pass tests properly