     ]
 
     var cancelItem: UIBarButtonItem!
-    var viewOrigin: CGFloat = 0.0
     var meme = Meme(topFieldText: "", bottomFieldText: "", originalImage: nil, memeImage: nil)
+    var memes: [Meme] = [Meme]()
 
 
     override func viewDidLoad() {

        let picker = UIImagePickerController()
        picker.delegate = self
        picker.sourceType = .Camera
        self.presentViewController(picker, animated: true, completion: nil)
    }

    func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
        print("finished")
        dismissViewControllerAnimated(true, completion: nil)
    }

    func albumTapped(sender: UIBarButtonItem) {
        let picker = UIImagePickerController()
        picker.delegate = self
        picker.sourceType = .SavedPhotosAlbum
        self.presentViewController(picker, animated: true, completion: nil)
    }

    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
        let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage

        self.imageView.image = selectedImage
        meme.originalImage = selectedImage

        dismissViewControllerAnimated(true, completion: nil)


    func generateMemedImage() -> UIImage {

        let topBarHeight = CGRectGetHeight((navigationController?.navigationBar.frame)!) + CGRectGetHeight(UIApplication.sharedApplication().statusBarFrame);
        let bottomBarHeight = CGRectGetHeight((navigationController?.toolbar.frame)!);
        let viewHeight = CGRectGetHeight(view.frame) - topBarHeight - bottomBarHeight
        let viewFrame = CGRectMake(0, topBarHeight, CGRectGetWidth(view.frame), viewHeight)

        // Render view to an image
        UIGraphicsBeginImageContext(view.frame.size)
