made code more readable and better :-)
Merge pull request #32 from florianbachmann/master

Use & instead of your large and error prone if statements