improved level detections plus boolean flags for LEDs