Added direction argument to .sortBy