Function computeDimensions

Computes the widths and lengths of all paths, adding them up as well