Added ability to turn off sorting and specify result size as config variables