Use accumulator for len function