Implemented dynamic programming algorithm