ported to zvmlib