Question about treatment of section 1231

Hello everyone, I have a question about treatment of section 1231 : 1. the net gain of section 1231 is treated as long term capital gain. 2. the lookback rule requires section 1231 gain offset by net loss for the 5 previous years that have not be recaptured. The net gain is treated as ordinary income. I am confusion with these two treatment: long-term capital gain and the Ordinary income after lookback. Can anyone explain it to me? Thank you very much for your time!!