handling of errors through return values, DEBUG error printing, verbose commenting