NEW fixed kcpsm3.sh script