Finished issue #1, need error checking

I hope my changes are ok, this is my first time contributing to a project! I can get to issue #2 later and I can probably add in some error checking if needed. Also say hi to mcomella :P