Implemented enqueue and dequeue operations.