Wrote new 'sharedDim' function, which is necessary now that
we are using more than just the centre ports.