dwawTable function fixed