smart sort with 4 method