Added sorting test and feature