Fixed up code.

* Changed the code to follow the new spec(addresses)
* Fixed a ton of comments
* Made use of stdbool