optimized front_x, saved 1 sort