implemented compound OT!
Fixes and refactoring for compound OT impl.