Slide version of cnot in java + some fixes.