transplanted the queue_str_task function from rtenv