Made IP resource into define instead of class so that it can be used more than once.