updated algorithm for durning on leds a bit