Adds a sort command and small fixes

4 jobs for sort in 41 minutes and 19 seconds (queued for 1 second)