Ported leeTM to work with zsim.