implement reinsertion in single insertion algorithm