modified source files, formatted error checking, improved functionality

This still has a LONG way to go until complete. Double check error cases and use cases.