Any ideas on how to deal with reading in matrices and manipulating them?