added _sub_ip function and it looks like it works