complete the integration of equeue, but equeue still has some bugs.