troubles

I have a 98 sportsman 500. my first problem is the starter turns the engine over but it wont crank it, I have to use the pull cord to start the engine. My biggest problem is when it gets hot it wont idle and if it shuts off it wont start back up until it cools down. it had a warped head on it when I got it so I put a head on it and adjusted everything according to the Hayes Repair Manual. I need help.