FCInv and FCFE/FCFF

These are the formulas I have down to derive FCInv based on any number of factors given. FCInv = Capex - Proceeds from Sale FCInv = Net PPE End - Net PPE Begin + Depreciation FCInv = Gross PPE End - Gross PPE Begin Proceeds from Sale can be backed into: Net PPE End = Net PPE Begin + Purchases - Depreciation - BV of Assets Sold. Proceeds from Sale = BV Sold + Gains on Sales Now my confusion lies with what to do with Gains on Sale assuming that only Gross or Net PPE is given. Sometimes I see it tacked on to end of FCInv: Example: FCInv = Net PPE End + Net PPE Begin + Depreciation - Gains on Sale. Isn’t that wrong? I think it should be subtracted to get to FCFF not subtracted from FCInv (because e you are subtracting FCInv to get to FCFF/FCFE, you would in fact be adding it back) So isnt the proper formula: FCFF = NI + NCC + Int (1-t) - WCinv - FCInv - Gain On Sale What I am trying to get it as I do not believe Gain on Sale has anything to do with FCInv in regards to this formula. It is just to get to the actual Cash Flow. I see it lumped in with the FCInv formula and do not see that as correct. Thoughts?