More documentation and re-styling of code.