                 y = 0
             }
 
-            var centerY = y + height / 2
-
-            let deviation = centerY / collectionViewHeight - 0.5
+            let deviation = (y + height / 2) / collectionViewHeight - 0.5
 
             if abs(nearestCenter.deviation) > abs(deviation) {
+                nearestCenter.row       = indexPath.row
                 nearestCenter.deviation = deviation
-                nearestCenter.cell = cell
             }
 
-            let cellInfo = (
+            let cellInfo: EventCellInfo = (
                 cell:      cell,
-                y:         centerY,
+                row:       indexPath.row,
                 height:    height,
                 deviation: deviation
             )

import Timepiece

class EventsCollectionViewController: UICollectionViewController {

    var calendar: Calendar!


        for cellInfo in cellInfos {
            cellInfo.cell.hidden = false

            if cellInfo.row == nearestCenter.row {
                UIView.animateWithDuration(0.3, animations: { () -> Void in
                    // println(nearestCenter.deviation - y)
                    // cellInfo.cell.transform = CGAffineTransformMakeTranslation(0, 100 * (cellInfo.deviation - nearestCenter.deviation))
                    // cellInfo.cell.contentView.bounds.size.height = cellInfo.height + 100
                    cellInfo.cell.transform = CGAffineTransformMakeTranslation(20, 0)
                })
            } else {
                UIView.animateWithDuration(0.3, animations: { () -> Void in
                    // println(nearestCenter.deviation - y)
                    // cellInfo.cell.transform = CGAffineTransformMakeTranslation(0, 100 * (cellInfo.deviation - nearestCenter.deviation))
                    //cellInfo.cell.contentView.bounds.size.height = cellInfo.height
                    cellInfo.cell.transform = CGAffineTransformMakeTranslation(0, 0)
                })
            }
        }
    }
}
