refactored log-det and computation framework