static int CompareUsers(User x, User y) { if (x.Actions == y.Actions) { return x.Name.CompareTo(y.Name); } return y.Actions.CompareTo(x.Actions); }