Added queuing so we can easily have many levels of recursion without mucking up readability and logical testing order.