distance functions are added
output files