@tailrec annotation added