Changing container from stack to queue