Can you annotate this with @tailrec?