Naive implementation of nextToProcess().