SetAttribute on node.

Fixes #2
Missing braces

Fixes #3
Source reformatting
Simplify function.
Refactoring

- Remove leading underscore from variables
- Add function to determine what result of the SQL query to return