Update code following Alex's suggestions.
Update code following Alex's suggestions.