compressed the many conditionals into two simple math operations
Merge pull request #2 from kaeza/master

Compressed the many conditionals into a few simple math operations