queue sort