correct implementation of eps clipping