added --plug, simplified footprint of get_length