finish source code of the circular queue