add checks for figure file name
use clog rather than log file
Merge branch 'master' into dev