need to work a little more on tail recursion