Logic and syntax fixes
Merge pull request #2 from mmiillkkaa/patch-1

Logic and syntax fixes