Started rewrite in Go