fixed error in vector value calculation