Improved Comments and Documentation
Added a check for KEY1 to set the emergency bit