Add sort
sort: Rewrite to avoid repetitive code
sort: Add type signature for main
Merge pull request #1 from alexander-b/master

Add sort