added sortArray and tagRemove