Making sure to use tail recursion for the recursive implementation and
replacing "foldLeft" with "/:"