<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_payload(self, payload):
 """ Adds a payload to packet, updating last payload's next_payload field """

        if self.payloads:
            self.payloads[-1].next_payload = payload._type
        self.payloads.append(payload)