merging LU decomposition