major changes to ksScript