brief documentation and error checking