Have understood getMatrix now. Changed some lines in the function to make it like it was earlier.