adding penalty to value function