Added function queue_get and some rework on the consumer logic