Saner way to set matrices and vectors