minor changes and removed some parentheses