Queueing related functions added
Queueing code merged