added arguments for sorting table, tests