first DP table generation works