Add sort option

Added a setSort method