Cleaned code
Now using glog for log handling.