revised to support multiple interfaces in one device