Added some code about queues. Need to add comments later