add vector function