New keynesian Model with habit forming consumers

Hi,

I have simulated the benchmark new keynesian model using the output gap consistent with most of the literature. However I have a challenge with trying to incorporate habit formation into the model by adjusting labmda in my original mod file to account for this.

I would be much obliged if anyone could take some few minutes to see what I have done wrong in the attached mod file. All opinions and corrections would be highly appreciated.