change to sorting approach