modified mscentipede code