added customized sort method