AliveChecking function + Recontructed some codes