refine code 0

still have some bug to fix