Changed read call to be iterative not recursive.