logZ is a function now