Initial import

This is my first push of code to GitHub, made as a pull request for easier review
I hadn't actually thought about that situation. I'm not sure exactly what I was thinking and my extra checking here may be unnecessary.