full LU related code