fixing code to pass tests