Dequeue implementation,