Started work on queueing function