prep_data_dist function

Prepares data and distance matrices for metric calculation