use counter to compute size of object vs .length