Fixed sort. Changed the and rules.