port LT/GT from master(r04), NOT tested! (faster sorting?)