Moved sort outside to be used on every argument