Something is wrong

The h2 value is below zero.
Producing negative values to indicate zero crossing

I think everything is working correctly now.