a whole bunch of toy dynamic programming code.