updated array_queue with modulus operator