Paraemeterise the code which makes the 'vm' argument