Another implementation of queue backed by array