updated with log-infunction