Kauffman_Matrix cleaned version