goTo method should recurse if given a function
Add documentation