add implementation for DotProduct