This could be done in one line with `fields.map(&:x).min || 0`.