move code to function get_dist_data