I was erroneously using a scalar for Q. I made it into a matrix. However, I am pretty sure it is still wrong. Q shouldn't be symmetric.