ejercicio4: Made correctly the logic to link slaves and masters. Only missing to make it work properly everything together