fixed godoc, general code cleanup