Edited processVector function.