added 'toArray()' method in Queue