version succeeding on all test cases