             }
             
         case .rightCenter:
-            attributes.center = CGPoint.init(x: (viewSize?.width)!-cellSize.width/2.0,
-                                             y: (contentOffset?.y)!+(viewSize?.height)!/2)
+            attributes.center = CGPoint.init(x: (viewSize.width)-cellSize.width/2.0,
+                                             y: (contentOffset.y)+(viewSize.height)/2)
             
             if (angle <= (M_PI+2.0*angleOffset+angular/180.0)) && (angle >= -angleOffset) {
                 attributes.isHidden = false

                                                     y: (CGFloat(sin(angle)*radius)+cellSize.height/2.0))
            }
        case .rightTop:
            attributes.center = CGPoint.init(x: (viewSize?.width)!-cellSize.width/2.0,
                                             y: (contentOffset?.y)!)
            
            if (angle <= (M_PI_2+2.0*angleOffset+angular/90.0)) && (angle >= -angleOffset) {
                attributes.isHidden = false

    }
    
    override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
        guard let collectionView = collectionView else { return nil }
        let viewSize = collectionView.bounds.size
        let cellSize = configuration.cellSize
        let angular = configuration.angular
        let radius = configuration.radius
        let fadeAway = configuration.fadeAway
        let contentOffset = collectionView.contentOffset
        let visibleCellIndex = Double(indexPath.item)-invisibleCellCount
        let attributes = UICollectionViewLayoutAttributes.init(forCellWith: indexPath)
        attributes.size = cellSize
