Initalizes ip correctly