Renamed memo algorithm to dyn_prog.

Also fixed a memory access violation.