     func collectionView(_ collectionView:UICollectionView, layout collectionViewLayout:UICollectionViewLayout, insetForSectionAt section:Int) -> UIEdgeInsets
     {
         let width:CGFloat = collectionView.bounds.maxX
-        let remain:CGFloat = width - kCellWidth
+        let cellsWidth:CGFloat = kCellWidth * CGFloat(model.items.count)
+        let remain:CGFloat = width - cellsWidth
         let margin:CGFloat = remain / 2.0
         let insets:UIEdgeInsets = UIEdgeInsetsMake(0, margin, 0, margin)
         

            self.collectionView.selectItem(
                at:indexPath,
                animated:false,
                scrollPosition:UICollectionViewScrollPosition.centeredHorizontally)
        }
    }
    

        if item !== model.current
        {
            selectItem(item:item)
        }
    }
}
