fix parentheses bug
Add addition logging and configuration