Implemented queue template