         collectionView.pagingEnabled = true
         collectionView.showsVerticalScrollIndicator = false
         collectionView.backgroundColor = UIColor.whiteColor()
+        collectionView.decelerationRate = UIScrollViewDecelerationRateFast
         self.view.addSubview(collectionView)
         
         // Register cell classes

        pageHeight = orientation.isPortrait ? screenBounds.size.height : screenBounds.size.width
    }
    
    func setCurrentPageNumber() {
        let indexPath = self.collectionView.indexPathsForVisibleItems().first as! NSIndexPath
        currentPageNumber = indexPath.row+1
    }
    
    func frameForPage(page: Int) -> CGRect {

    
    override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
        setPageSize(toInterfaceOrientation)
        setCurrentPage()
        
        UIView.animateWithDuration(duration, animations: { () -> Void in
            self.collectionView.contentSize = CGSizeMake(self.pageWidth, self.pageHeight * CGFloat(self.totalPages))
