added sorting algo to its own package