Improves ip function.