Minor change in flush(); avoided loop declaration