Added sorting direction