updated the C&I function

corrected the logic for C&I