better use of docstring for initialize function, and error reporting