remove unnessesary and redundant sort