Initial implementation of the work queue