added ip function