Added logic
Merge pull request #1 from jamessimo/master

Added logic