improved dot product solution

Of course I figure out how to do it without helper functions immediately
after submitting the solution that uses them.