CMP functionality

- CMP ALMOST complete. Still one test messing up. Other than that, it should be completely tested.