Adding tests and adding sorting to sub-arrays in sortnumarrays