public int calculateDistance(MazeCell A, MazeCell B){
       
        int colOfA = A.get_MazeCellcol();
        int rowOfA = A.get_MazeCellrow();
        int colOfB = B.get_MazeCellcol();
        int rowOfB = B.get_MazeCellrow();
        int distanceRows = rowOfB- rowOfA;
        int distanceCols = colOfB- colOfA;
        
		//if(A == null) System.out.println("PROBLEEEEEEEEEM7");
		//if(B == null) System.out.println("PROBLEEEM8");

        if(distanceRows<0)distanceRows=rowOfA-rowOfB;
        if(distanceCols<0)distanceCols=colOfA-colOfB;
        
         if((distanceRows == 0) || (distanceCols == 0)){
			if((distanceRows == 0) && (distanceCols == 0)){ 
				//System.out.println("PROBLEEEM8");
                return 0;
			}
         	else if(distanceRows == 0){
				//System.out.println("PROBLEEEM9");
                return distanceCols;
			}
         	else {
				//System.out.printf("distanceRows is %d\n",distanceRows);
                return distanceRows;
			}
		 }
         else{
         	if(distanceRows < distanceCols){
				//System.out.println("PROBLEEEM11");
            	return distanceRows;
			}
           	else{
				//System.out.println("PROBLEEEM12");
            	return distanceCols;
			}
		}
	}