Better logic in led toggle