Solved problems 25 and 26. Working on second half of problem 27