Added adapative realtime dynamic programming