quarterSort works finally