megavdp: no more global variables needed, at last. nw.