31 complete. This could have been done with recursion or dynamic programming