Got building of matrices running quite reliably