         if (lastContentOffsetX < scrollView.contentOffset.x) {
             
             println("moving >>>>>>>>")
-        } else if (lastContentOffsetX == scrollView.contentOffset.x) {
             
-            println("im in zero")
+            if (scrollView.contentOffset.x == endContentOffSet) {
+                
+                scrollRectToVisible(CGRectMake(frame.width, 0, frame.width, frame.height), animated: false)
+            }
+            
         } else {
             
             println("moving <<<<<<<<")
+            
+            if (scrollView.contentOffset.x == 0) {
+                
+                scrollRectToVisible(CGRectMake(endContentOffSet - frame.width, 0, frame.width, frame.height), animated: false)
+            }
         }
         
         lastContentOffsetX = scrollView.contentOffset.x
 
     }
-    
-    func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool){
-    }
-    
-    
 }

    
    var lastContentOffsetX:CGFloat
    var imageView:UIImageView?
    
    init(frame: CGRect, photos: [UIImage?]) {
    
        lastContentOffsetX = 0
        UIScrollView(frame: frame)
        super.init(frame: frame)
        delegate = self

        showsHorizontalScrollIndicator = false
        contentMode = UIViewContentMode.ScaleAspectFit
        addImages(photos)
        
        scrollRectToVisible(CGRectMake(endContentOffSet - frame.width, 0, frame.width, frame.height), animated: false)
    }

    required init(coder aDecoder: NSCoder) {
