much faster means of computing matrices