converted to a go library