Problems 21, 22, 23, 24

I've added a few more test cases.