cleaning and organizing, added deallocation and queueing methods