fixed error in ksSubcode
added tokens+fixed ks interpretation error