r1.10 adding log file and reducing code