edit on RedBlackTree to sorting, but bad mem