added type checks for add, sub, mul, etc.