replaced while loop with recursion. i like that better