Added tail recursive function recur