     
     override func layoutAttributesForSupplementaryView(ofKind elementKind:String, at indexPath:IndexPath) -> UICollectionViewLayoutAttributes?
     {
-        for layoutAttribute:UICollectionViewLayoutAttributes in headerLayoutAttributes
+        let listAttributes:[UICollectionViewLayoutAttributes]
+        
+        if elementKind == UICollectionElementKindSectionHeader
+        {
+            listAttributes = headerLayoutAttributes
+        }
+        else
+        {
+            listAttributes = footerLayoutAttributes
+        }
+        
+        for layoutAttribute:UICollectionViewLayoutAttributes in listAttributes
         {
             if layoutAttribute.indexPath.section == indexPath.section
             {

            {
                var index:Int = 0
                var positionX:CGFloat = 0
                
                for item:MLinearEquationsSolutionEquationItem in equation.items
                {
                    let indexPath:IndexPath = IndexPath(
                        item:index,

        super.prepare()
        
        headerLayoutAttributes = []
        footerLayoutAttributes = []
        cellLayoutAttributes = []
        
        var section:Int = 0
