basically works in a more "dynamic programming" manner