improve sort genome script