adds distance and header