Added some documentation and minor tweaks.