Swift arrays can be easily sorted with the function sort(<#isOrderedBefore: (T,
T) -> Bool##(T, T) -> Bool#>). You can use closures or move it to a separate
function. I prefer to move all code to a separate function as I use the sorting
multiple times in my project.