Terribly slow recursive solution
Fixed stupid infinite recursion bug
The list version works.