Created Upi function