Added tests 31,32 and 33. Also made a few corrections and improvements to 13,16,17,20,21,22,24,31 and 32.