Refactored code to remove comments and unused variables. Also had to duplicate the emergencyResolved socket event to ensure that the client was also removing the overlay when an emergency has been resolved.