I think this can be done as a vector operation.

untested:
```python
BC2 = BC + sum(CIJ*BC,axis=0) + sum(CIJ,axis=2).T*BC
```