Implemented queue using an array