 
   showPage: (page) ->
     @page = page
-    xOffset = @userListItemWidth() * @numberOfUsersInX * @page
+    xOffset = @userListItemWidth() * @options.numberOfUsersInX * @page
     @ui.scrollingInner.css 'left', -xOffset
     @updateButtonStates()
 

    @page > 0

  hasNextPage: ->
    (@page+1) * @numberOfUsersInX < @totalNumberOfItemsInX()

  totalNumberOfItemsInX: ->
    Math.ceil(@shuffledCollection.size() / @numberOfUsersInY)

  userListItemWidth: ->
    # Return some random number so on subsequent renders the
    # TourUserViews are not clipped
    return 500 if @shuffledCollection.isEmpty()

    finish: '.js-finish'
    scrollingInner: '.js-scrolling-inner'

  templateHelpers: ->
    next_tourstep_path: window.next_tourstep_path

  initialize: ->
    @page = 0
    @shuffledCollection = new TourUsers

    @options.numberOfUsersInX ?= 4
    @options.numberOfUsersInY ?= 2

  onRender: ->
    @ui.finish.hide()
