Improved enqueue and dequeue operations

Fixed logic for resizing and moving to zero index