Finishing block reaching output, and adds the next blocks to the queue