store the previous sorting