rewrite demo , add logic files