2013-09-24: try to add the function dbg
2013-09-24:try to write the function for dbg