simple the logic
small edit
Merge pull request #72 from Pana/master

simple the logic