using arrays for queue