Initial revision before help session. 22/41 test cases passed.