rearrange code
fix Undefined variable
optimize All Objects Graph