Removed unneeded variables

- sortdir
- sort criteria