tried to fix bug #; moved definition of RelayPin