added small error checking, refactoring, and bit of documentation to starshot