adding some godocs and fixing some code layout issues.