                 topCorrect = topCorrect < 0 ? 0 : topCorrect
                 textView.contentOffset = CGPoint(x: 0, y: -topCorrect)
             }
-            if contentHeight >= height {
-                topCorrect = contentHeight - height
-                topCorrect = topCorrect < 0 ? 0 : topCorrect
+            if contentHeight >= height { //if the contentSize is greater than the height
+                topCorrect = contentHeight - height //set the contentOffset to be the
+                topCorrect = topCorrect < 0 ? 0 : topCorrect //contentHeight - height of textView
                 textView.contentOffset = CGPoint(x: 0, y: topCorrect)
             }
         }

            var topCorrect: CGFloat = 0.0
            switch(self.verticalAlignment){
            case .Top:
                textView.contentOffset = CGPointZero
            case .Middle:
                topCorrect = (height - contentHeight * textView.zoomScale)/2.0
                topCorrect = topCorrect < 0 ? 0 : topCorrect

    
    var verticalAlignment: VerticalAlignment = .Middle
    
    //override contentSize property and observe using didSet
    override var contentSize: CGSize {
        didSet {
            let textView = self
