implemented criticalRegister(), ready to test on ilab