Added functions to estimate zinm (testing).