Finally, it modifies the flags pointer of the new singleton class to mark it as a singleton class.
The reason it does this is that if you don't, the object thinks this new class is its actual class instead of its singleton class.