Added the COEN Functions

I made the COEN function and a function to add the CTW classes to the
matrix