major refactoring done. Parenthesis works now