got my only test to pass and cleaned up the code a bit