updated myipfunction