sort by pi and years