sergio testing
added emergency detection
soem emergencyswitch working