Better sorting JS