Merge pull request #10 from awp1121/master

merge logic from awp
Merge pull request #14 from scaperoth/master

Merge pull request #10 from awp1121/master