Change LU Decomp to fix ref issues