updated vector function