Added get_ip function