rewrite delta calculation
Merge pull request #29 from adrx/altDelta

rewrite delta calculation