working vmc, with g optimization