         return padding
     }
     
+    public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
+        switch (collectionConfiguration.scrollingDirection, delegate) {
+        case (.horizontal, .some(let delegate)):
+            let inset = delegate.verticalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
+            return UIEdgeInsetsMake(inset, 0, inset, 0)
+        case (.vertical, .some(let delegate)):
+            let inset = delegate.horizonalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
+            return UIEdgeInsetsMake(0, inset, 0, inset)
+        case (_, _):
+            return UIEdgeInsetsMake(0, 0, 0, 0)
+        }
+    }
+    
     public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        let size = collectionConfiguration.scrollingDirection == .horizontal ? CGSize(width: cellSize, height: collectionView.bounds.size.height) : CGSize(width: collectionView.bounds.size.width, height: cellSize)
-        return size
+        switch (collectionConfiguration.scrollingDirection, delegate) {
+        case (.horizontal, .some(let delegate)):
+            let height = collectionView.bounds.size.height - 2*delegate.verticalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
+            return CGSize(width: cellSize, height: height)
+        case (.vertical, .some(let delegate)):
+            let width = collectionView.bounds.size.width - 2*delegate.horizonalPaddingForHorizontalInfiniteScrollingBehaviour(behaviour: self)
+            return CGSize(width: width, height: cellSize)
+        case (.horizontal, _):
+            return CGSize(width: cellSize, height: collectionView.bounds.size.height)
+        case (.vertical, _):
+            return CGSize(width: collectionView.bounds.size.width, height: cellSize)
+        }
     }
     
     public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

            delegate?.didEndScrolling(inInfiniteScrollingBehaviour: self)
        }
    }

}

extension InfiniteScrollingBehaviour: UICollectionViewDataSource {

        }
    }
}

