renamed multiply to dotProduct