adding led logic