fixes some code to pass tests