sorting finally works