added dot product functionality and fixed some type checking to isinstance()