Changed the circular queue into a dynamic-circular queue