added missing * operator
bug fix in reduce
added more checks for types, allowed sum and product functions for vectors and matrices