added sort and stats buttons.