improved sorting in agenda some more