added pseudocode for device registration