Improved comment and introduced temporary variable in loop.