Replaced recursion with a loop in authorsString