Added simple substitution of size variables
Handle products, equals and not equals