use modular operation in the circular queue