Remove Dupe Code and Add More Error Checking

Again need to test this.
Merge pull request #8 from Relicum/patch-3

Remove Dupe Code and Add More Error Checking