add getbedlength.  useful for debugging