found an error in the PreAllocatedFinalQMatrix