fixing code to follow rules and still pass tests