clean up wilson score sorting code