     override public func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.
-        self.viewControllers.removeAll()
-        self.views.removeAll()
+        viewControllers.removeAll()
+        views.removeAll()
     }
 
     // MARK: - SCROLLVIEWDELEGATE
 
     public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
-        if (self.currentIndex-2 >= 0) {
-            self.clearSlot(index: self.currentIndex-2)
-        }
-        if (self.currentIndex+2 < self.numberOfViews-1) {
-            self.clearSlot(index: self.currentIndex+2)
-        }
-        self.scrollDelegate?.scrollViewDidEndDecelerating?(scrollView)
+        if (currentIndex-2 >= 0) {
+            clearSlot(index: currentIndex-2)
+        }
+        if (currentIndex+2 < numberOfViews-1) {
+            clearSlot(index: currentIndex+2)
+        }
+        scrollDelegate?.scrollViewDidEndDecelerating?(scrollView)
     }
 
     public func scrollViewDidScroll(_ scrollView: UIScrollView) {
-        let page = (self.scrollDirection == .Horizontal) ? (scrollView.contentOffset.x + (0.5 * self.pageSize.width)) / self.pageSize.width : (scrollView.contentOffset.y + (0.5 * self.pageSize.height)) / self.pageSize.height
-
-        self.currentIndex = Int(page)
-        self.pageControl.currentPage = self.fixIndex(index: self.currentIndex)
+        let page = (scrollDirection == .Horizontal) ? (scrollView.contentOffset.x + (0.5 * pageSize.width)) / pageSize.width : (scrollView.contentOffset.y + (0.5 * pageSize.height)) / pageSize.height
+
+        currentIndex = Int(page)
+        pageControl.currentPage = fixIndex(index: currentIndex)
 
         // last element, only for infinite mode
-        if (self.infinite == true) {
-            (self.scrollDirection == .Horizontal) ? self.checkDidScrollInfiniteModeWithX(scrollView: scrollView) : self.checkDidScrollInfiniteModeWithY(scrollView: scrollView)
-        }
-
-        self.lastScrollViewOffset = self.scrollView.contentOffset
-        self.scrollDelegate?.scrollViewDidScroll?(scrollView)
+        if (infinite == true) {
+            (scrollDirection == .Horizontal) ? checkDidScrollInfiniteModeWithX(scrollView: scrollView) : checkDidScrollInfiniteModeWithY(scrollView: scrollView)
+        }
+
+        lastScrollViewOffset = scrollView.contentOffset
+        scrollDelegate?.scrollViewDidScroll?(scrollView)
     }
 
     public func scrollViewDidZoom(_ scrollView: UIScrollView) {
-        self.scrollDelegate?.scrollViewDidZoom?(scrollView)
+        scrollDelegate?.scrollViewDidZoom?(scrollView)
     }
 
     public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        self.scrollDelegate?.scrollViewWillBeginDragging?(scrollView)
+        scrollDelegate?.scrollViewWillBeginDragging?(scrollView)
     }
 
     public func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
         self.targetContentOffset = targetContentOffset.pointee
-        self.scrollDelegate?.scrollViewWillEndDragging?(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset)
+        scrollDelegate?.scrollViewWillEndDragging?(scrollView, withVelocity: velocity, targetContentOffset: targetContentOffset)
     }
 
     public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
-        self.scrollDelegate?.scrollViewDidEndDragging?(scrollView, willDecelerate: decelerate)
+        scrollDelegate?.scrollViewDidEndDragging?(scrollView, willDecelerate: decelerate)
     }
 
     public func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) {
-        self.scrollDelegate?.scrollViewWillBeginDecelerating?(scrollView)
+        scrollDelegate?.scrollViewWillBeginDecelerating?(scrollView)
     }
 
     public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
-        self.scrollDelegate?.scrollViewDidEndScrollingAnimation?(scrollView)
+        scrollDelegate?.scrollViewDidEndScrollingAnimation?(scrollView)
     }
 
     public func viewForZooming(in scrollView: UIScrollView) -> UIView? {
-        return self.scrollDelegate?.viewForZooming?(in: scrollView)
+        return scrollDelegate?.viewForZooming?(in: scrollView)
     }
 
     public func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) {
-        self.scrollDelegate?.scrollViewWillBeginZooming?(scrollView, with: view)
+        scrollDelegate?.scrollViewWillBeginZooming?(scrollView, with: view)
     }
 
     public func scrollViewDidEndZooming(_ scrollView: UIScrollView, with view: UIView?, atScale scale: CGFloat) {
-        self.scrollDelegate?.scrollViewDidEndZooming?(scrollView, with: view, atScale: scale)
+        scrollDelegate?.scrollViewDidEndZooming?(scrollView, with: view, atScale: scale)
     }
 
     public func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
-        if let bool = self.scrollDelegate?.scrollViewShouldScrollToTop?(scrollView) {
+        if let bool = scrollDelegate?.scrollViewShouldScrollToTop?(scrollView) {
             return bool
         }
         return true
     }
 
     public func scrollViewDidScrollToTop(_ scrollView: UIScrollView) {
-        self.scrollDelegate?.scrollViewDidScrollToTop?(scrollView)
+        scrollDelegate?.scrollViewDidScrollToTop?(scrollView)
     }
 
     public func screenDidRotate() {
-        self.pageSize = self.view.frame.size
-        let width = (self.scrollDirection == .Horizontal) ? CGFloat(self.numberOfViews)*self.pageSize.width : self.pageSize.width
-        let height = (self.scrollDirection == .Horizontal) ? self.pageSize.height : CGFloat(self.numberOfViews)*self.pageSize.height
-        self.scrollView.contentSize = CGSize(width: width, height: height)
-
-        for view in self.views {
+        pageSize = view.frame.size
+        let width = (scrollDirection == .Horizontal) ? CGFloat(numberOfViews)*pageSize.width : pageSize.width
+        let height = (scrollDirection == .Horizontal) ? pageSize.height : CGFloat(numberOfViews)*pageSize.height
+        scrollView.contentSize = CGSize(width: width, height: height)
+
+        for view in views {
             if let view = view {
                 let index : Int = view.tag
-                let x : CGFloat = (self.scrollDirection == .Horizontal) ? CGFloat(index)*self.pageSize.width : 0.0
-                let y : CGFloat = (self.scrollDirection == .Horizontal) ? 0.0 : CGFloat(index)*self.pageSize.height
-                view.frame = CGRect(x: x, y: y, width: self.pageSize.width, height: self.pageSize.height)
-            }
-        }
-        self.setCurrentPage(newValue: self.currentIndex, animated: false)
+                let x : CGFloat = (scrollDirection == .Horizontal) ? CGFloat(index)*pageSize.width : 0.0
+                let y : CGFloat = (scrollDirection == .Horizontal) ? 0.0 : CGFloat(index)*pageSize.height
+                view.frame = CGRect(x: x, y: y, width: pageSize.width, height: pageSize.height)
+            }
+        }
+        setCurrentPage(newValue: currentIndex, animated: false)
     }
 }
 

    // true if it should rotate and detect rotation
    public var canRotate : Bool = false {
        didSet {
            if self.canRotate == true {
                NotificationCenter.default.addObserver(self, selector: "screenDidRotate", name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
            } else {
                NotificationCenter.default.removeObserver(self)

        var fixedIndex = index

        // if it's infinite, i fix the index to not ask views which does not exist
        if infinite == true {
            if index == 0 {
                fixedIndex = numberOfViews-3
            } else if (index == numberOfViews-1) {
                fixedIndex = 0
            } else {
                fixedIndex -= 1
