Place sugar, flour and salt in saucepan and mix thoroughly, stir in milk. Cook over medium heat and stir constantly until very thick. Remove from heat and pour into a medium mixing bowl. Cool to room temperature. Add 1/2 cup butter at a time (cut into several pieces) and beat at medium-high speed until smooth. Add vanilla and beat well. Chill icing for a few minutes before decorating. Iced cupcakes must be refrigerated until serving time.