format_distribution function

Format distribution data into a long table format