added error.go and types.go