<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_service(self, loadbal_id, service_group_id, ip_address_id, port=80, enabled=True, hc_type=21, weight=1):
 """Adds a new service to the service group. :param int loadbal_id: The id of the loadbal where the service resides :param int service_group_id: The group to add the service to :param int ip_address id: The ip address ID of the service :param int port: the port of the service :param bool enabled: Enable or disable the service :param int hc_type: The health check type :param int weight: the weight to give to the service """

        kwargs = utils.NestedDict({})
        kwargs['mask'] = ('virtualServers['
                          'serviceGroups[services[groupReferences]]]')

        load_balancer = self.lb_svc.getObject(id=loadbal_id, **kwargs)
        virtual_servers = load_balancer['virtualServers']
        for virtual_server in virtual_servers:
            if virtual_server['id'] == service_group_id:
                service_template = {
                    'enabled': int(enabled),
                    'port': port,
                    'ipAddressId': ip_address_id,
                    'healthChecks': [
                        {
                            'healthCheckTypeId': hc_type
                        }
                    ],
                    'groupReferences': [
                        {
                            'weight': weight
                        }
                    ]
                }
                services = virtual_server['serviceGroups'][0]['services']
                services.append(service_template)

        return self.lb_svc.editObject(load_balancer, id=loadbal_id)