Add dynamic spacing for sub-functions.