updated code for VC