Added tailrec annotation.