Code updated to use with Go 1