cleaned up and documented msCentipede code. need to add a few checks and test the code.