modify length method