Initial import.
modified for Go 1.