Davies Liu patches #1: tianzhongbo commits

Now better, starting with current 'dev' branch