some logic changes
Merge pull request #2 from AdamHolwerda/master

some logic changes