how are heavy elements such as carbon, oxygen and neon formed during star formation​