Outputs formatted results to file. Also rounds distance to nearest integer in calculations.