added implementation in Go