2Bring water to a boil in large saucepan. Add potatoes and cook until tender. Drain, reserving liquid. Set aside potatoes. Measure 1 cup of cooking liquid, adding water, if necessary and set aside.
3Peel and finely chop onion. Melt butter in saucepan over medium heat. Add onion to saucepan and cook, stirring frequently, until onion is translucent and tender, but not brown.
4Add flour to saucepan. Season with pepper flakes and black pepper to taste. Cook 3 to 4 minutes.
5Gradually add potatoes, reserved 1 cup cooking liquid, milk and sugar to onion mixture in saucepan. Stir well. Add cheese and ham and simmer over low heat for 30 minutes, stirring frequently. Store leftovers, covered, in refrigerator.