added basis for the dynamic programming