reorganization of kgScript completed fixes #4