implementation of circular queue