The first draft of chchematrix.R