Added Dummies and used free_symbols() instead of is_constant()