minor changes and added unit-test (log-det)