adding unique name to vc, reorganizing code