dryer shuts off part 2

I have a whirlpool dryer ultimate care 2.

3 Days ago I smelled a burning smell. It doesnt smell like a electrical burning smell, but it is very strong. Yesterday I removed the back panel of the dryer and cleaned all of the lint out. I was very carefull around the heating element. I turned the dryer back on and watched the heating element glow red for a minute and go back off. The smell is not as bad now. Now the dryer will turn on for aprox 2 min the shut off for about 5 min then turn back on over and over agian. While I had the cover off I noticed a yellow wire with a red stripe hanging loose. I dont know where that goes. SOMEONE PLEASE HELP.

I have now taken the dryer apart. I took the drum out and tested the dryer. The dryer now stays running. The smell is coming from the motor. The heating element stays on (red) does not shut off. The motor has a squeel that comes and goes.

HOPEFULLY THIS NEW INFO WILL HELP SOMEONE FIGURE OUT WHAT IS WRONG HERE.