Made some modifications in the code, mainly in PurchaseTab