before dynamic programming