initial rewrite of gsindex in go