Button now works in 2 directions: sort/unsort. Precalculating sorted data for smoother transition