added the sorting  selector, also the javascript to link it