What does a star become before ending up as a white dwarf?

**********