Sort correctly