added tot to table, still need to write module to compute tot_gain