worked on prob 27 (still needs to be faster), finished probs 29 and 30.