Updated Inv code