Added the CIM method and also made some other fixes