CPUMatrix code enhancement