trim condition minimizes dz/dx
Merge pull request #6 from blandry/master

trim condition minimizes dz/dx