added basic logic for creating a relay