Added chance.ip function and its test