Adds initial code for distance integration.