public static void printMat(Double[][] mat) throws IOException
	{
		String matrix = "{";
		for (int i = 0; i < mat.length; i++)
		{
			matrix += "{";
			for (int j = 0; j < mat[i].length; j++)
			{
				if (j != mat[i].length - 1)
					matrix += mat[i][j] + ", ";
				else
					matrix += mat[i][j];
			}
			if (i != mat.length - 1)
				matrix += "}, ";
			else
				matrix += "}";
		}
		matrix += "}";
		bw.write(matrix + "\n");
	}