It works with parentheses + bug fixes

It should be finished now...