Replace cc by ccc for matrix with three columns