added function to get distance between vectors