add chart, optimize code, new interface