some modifications to work with LED instead of relay