smooth sort fix