build_table function added