History updated with sorting