works with simple equations, there must be a problem with complex ones