         for photo in photos {
             
             imageView = UIImageView(frame: CGRectMake(x, frame.origin.y, frame.size.width, frame.size.height))
+            
+            
+            if (x == 0) {
+    
+                imageView!.image = photos.last!
+                x += frame.width
+                addSubview(imageView!)
+                
+                imageView = UIImageView(frame: CGRectMake(x, frame.origin.y, frame.size.width, frame.size.height))
+                addSubview(imageView!)
+            }
+
             imageView!.image = photo
+            
             
             x += frame.width
             
             addSubview(imageView!)
         }
+
+        endContentOffSet = x
         
+        imageView = UIImageView(frame: CGRectMake(x, frame.origin.y, frame.size.width, frame.size.height))
+        imageView!.image = photos.first!
+        
+        x += frame.width
+        addSubview(imageView!)
         contentSize = CGSizeMake(x, imageView!.frame.size.height)
-    }
-    
-    func addImage() {
-        
-    }
-    
-    func scrollViewDidScroll(scrollView: UIScrollView){
-        /* Gets called when user scrolls or drags */
     }
 
     func scrollViewDidEndDecelerating(scrollView: UIScrollView){

        if (lastContentOffsetX < scrollView.contentOffset.x) {
            
            println("moving >>>>>>>>")
        } else if (lastContentOffsetX == scrollView.contentOffset.x) {
            
            println("im in zero")
        } else {
            
            println("moving <<<<<<<<")
        }
        
        lastContentOffsetX = scrollView.contentOffset.x

    }
    
    func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool){
    }
    
    
}

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