now using np.sort, as sortdoes not work for np arrays