initial create build_table and best_first functions