updateSize was not updating the size array correctly