changes to kgScript