added sorted to return queue