added dotProduct