adapted the signature of the subdivide function to allow for offsets in the input boxes
calculate input offsets based on the output boxes