Changed Cholesky decomposition to two different ones, returning upper or lower triangular matrices