added initial value iteration code