rewrote GetIP to utilize these functions