corrected some errors in table computation
correct table computation