added ability to specify sorting method for countries