     getCountryId = (region) ->
       $('#' + region + 'country select').val()
 
-    updateState = (region) ->
+    Spree.updateState = (region) ->
       countryId = getCountryId(region)
       if countryId?
         unless Spree.Checkout[countryId]?

        stateSelect.removeClass('required')

    ($ '#bcountry select').change ->
      updateState 'b'

    ($ '#scountry select').change ->
      updateState 's'

    updateState 'b'

    order_use_billing = ($ 'input#order_use_billing')
    order_use_billing.change ->

            Spree.Checkout[countryId] =
              states: data.states
              states_required: data.states_required
            Spree.fillStates(Spree.Checkout[countryId], region)
        else
          Spree.fillStates(Spree.Checkout[countryId], region)

    Spree.fillStates = (data, region) ->
      statesRequired = data.states_required
      states = data.states

