more efficient version of DVMS (bugs fixed)