Added note on optmisation using DP.