added hysteresis buffer based on active high/low

Fixes #127