p4/main.go: Added comments and made some code changes.