possible solution chachematrix.R