         title <<"1/B / "<<colors.scalemin()<<"  " << colors.scalemax()<<"\t";
         render.renderQuad( visual3, grid.n()*grid.Nx(), grid.n()*grid.Ny(), colors);
 
-        colors.scalemax() = (float)thrust::reduce( visual4.begin(), visual4.end(), 0., dg::AbsMax<double>()  );
+        colors.scalemax() = (float)thrust::reduce( visual4.begin(), visual4.end(),  -1.0, thrust::maximum<double>()  );
         colors.scalemin() =  (float)thrust::reduce( visual4.begin(), visual4.end(), colors.scalemax() ,thrust::minimum<double>() );
         title <<"K^R / "<<colors.scalemin()<<"  " << colors.scalemax()<<"\t";
         render.renderQuad( visual4, grid.n()*grid.Nx(), grid.n()*grid.Ny(), colors);
         
-        colors.scalemax() = (float)thrust::reduce( visual5.begin(), visual5.end(), 0., dg::AbsMax<double>()  );
+        colors.scalemax() = (float)thrust::reduce( visual5.begin(), visual5.end(), -1.0, thrust::maximum<double>()   );
         colors.scalemin() =  (float)thrust::reduce( visual5.begin(), visual5.end(), colors.scalemax() ,thrust::minimum<double>() );
+//                 colors.scalemax() = -0.0058;
+//         colors.scalemin() = -0.009;
         title <<"K^Z / "<<colors.scalemin()<<"  " << colors.scalemax()<<"\t";
         render.renderQuad( visual5, grid.n()*grid.Nx(), grid.n()*grid.Ny(), colors);
         

    dg::blas2::gemv( equigrid, hvisual4, visual4);
    dg::blas2::gemv( equigrid, hvisual5, visual5);
    dg::blas2::gemv( equigrid, hvisual6, visual6);

    //Create Window and set window title
    GLFWwindow* w = draw::glfwInitAndCreateWindow( 1800, 300, "");
    draw::RenderHostData render( 1, 6);
  
    //create a colormap
    draw::ColorMapRedBlueExtMinMax colors(-1.0, 1.0);

#include <fstream>
#include <sstream>
#include "file/read_input.h"
#include <cmath>

#include "draw/host_window.h"
int main()
{
    unsigned Nx,Ny,n;
//     double Nxh = Nx/2.,Nyh=Ny/2.;
//     double a, elongation,triangularity;
    double Rmin,Zmin,Rmax,Zmax;
//     double A,R_0,psipmin,psipmax;
//     std::vector<double> c(13);
        std::cout << "Type n, Nx, Ny\n";
    std::cin >> n>> Nx>>Ny;
    
    std::vector<double> v;
    try{ v = file::read_input( "geometry_params.txt"); }
