made the queue function a class function