added dot product functionality and fixed some type checking to isinstan...

...ce()