fixed issues with negative input values
Merge pull request #1 from fudgefactor/negatives_fix

fixed issues with negative input values