change q_insert so that indices = length of queue are accepted