first pass at go rewrite