I recommend freshly grating your own cheese. It melts more smoothly than pre-shredded cheese because it does not contain added preservatives and anti-caking agents.  Also when mixing the flour, milk and cheese in saucepan make sure you stir it constantly to prevent lumps.