getting the matrices set up