Ass3.Prob3 using queues. Still some optimizations to be done.