wrote a test case for 30 and 31 and made it pass