fix a bug and get a perfect version of optimization, but still need some recheck and polish, also delete dbg info