public static int eval(double d)
      {
      
         if(d<=0.4)
            return 0;
         if(d<=0.7)
            return 1;
         if(d<=0.9)
            return 2;
         else
            return 3;
      }