The main factor that shapes the life and eventual death of a star is its