Implemented Queues. The queue is emptied if the optimizer is shutdown. Fixed outputfile bugs.