     // Returns a brush based on its name (its filename minus the extension)
     Image@ GetBrushImage(String brushName)
     {
-        for(uint i = 0; i < brushes.length; ++i)
+        for (uint i = 0; i < brushes.length; ++i)
         {
-            if(brushes[i].name == brushName)
+            if (brushes[i].name == brushName)
             {
                 return brushes[i];
             }

        SetSceneModified();

        // Add that terrain to the terrainsEdited if its not already in there
        if(terrainsEdited.FindByRef(terrainComponent) == -1)
            terrainsEdited.Push(terrainComponent);

        // Only work if a brush is selected
        if(selectedBrushImage !is null){
            uint brushImageWidth = selectedBrushImage.width;
            uint brushImageHeight = selectedBrushImage.height;

            switch(editMode)
            {
                case TERRAIN_EDITMODE_RAISELOWERHEIGHT: {
                    // Iterate over the entire brush image
                    for(int y = 0; y < brushImageHeight; ++y)
                    {
                        for(int x = 0; x < brushImageWidth; ++x)
                        {
                            // Get the current terrain height at that position (centred to the brush's size)
                            IntVector2 pos = IntVector2(position.x + x - (brushImageWidth / 2), position.y + y - (brushImageHeight / 2));

                                float avgB = 0.0f;

                                // Get the average of those pixels
                                for (uint i = 0; i < adjacentColors.length; ++i)
                                {
                                    avgR += adjacentColors[i].r;
                                    avgG += adjacentColors[i].g;
