finally realized that queue is a wrapper around an array and it does not have indices