Moving sort method which is only used the first time