Added VectorMagnitude function