now writes tables out of iHH values for each segment