- use glog instead of Debug flag
- use glog instead of log
- make code conform to the Go code guidelines