Finished implementing queue functions