first draft go implementation