@Override
	public void save(){
		// get file full path&name by fileName 
		File file = new File(fileName);
		BufferedWriter out;
		System.out.println("bufferedWriter.out created");
		
		//	save the last board - put it in history
		int [][] lastPosition = new int[rows][columns];
		for(int i=0;i<rows;i++){
			for(int j=0;j<columns;j++){
				lastPosition[i][j] = maze[i][j];
			}
		}		
		int lastMouse[] = new int[2];
		lastMouse[0] = mouse[0];
		lastMouse[1] = mouse[1];
		
		old_mouse.push(lastMouse);
		old_score.push(score);
		old_states.push(lastPosition);		
		
		try {
			out = new BufferedWriter(new FileWriter(file));
			System.out.println("bufferedWriter.out initialized");
			// save size of the maze;
			out.write(""+rows);
			out.newLine();
			out.write(""+columns);
			out.newLine();			
			// -------- save start&goal locations -------- //
			// gives:  "row,column" of the goal 
			for(int i : goal_s){
				out.write(""+i+',');
			}
			out.newLine();
			// gives:  "row,column" of the start 
			for(int i : start_s){
				out.write(""+i+',');
			}
			out.newLine(); 
			// save walls 
			out.write(""+walls.length);
			out.newLine();
			for(int w[]  : walls ){
				for(int n : w){
					out.write(""+n+',');
				}
				//out.write(" @ ");
			}
			out.newLine();			
			// ---------- save history ---------- // 
			// save our history size - get size of some  old_stack (all have to be the same size)
			out.write(""+old_states.size());
			out.newLine();
			// save mouse history : in one row separated by '@' ; mouse rows/columns separated by ','
			for(int[] m: old_mouse){
				for(int n: m){
					out.write(""+n+',');
				}
			//	out.write(" @ ");
			}
			out.newLine();
			// save score history : in one row separated by ','
			for(Integer s : old_score){
				out.write(""+s+',');
			}
			out.newLine();
			// save maze state history : each state separated by new line "\n" ; each number (cell value) separated by ','
			for(int [][] s: old_states){
				for(int  i=0 ; i < rows ; i++){
					for(int j=0 ; j < columns ; j++){
						out.write(""+s[i][j]+',');	
					}
					out.newLine();
				}
			}			
		// save succeed value
			if(succeed){
				out.write(""+1);
			}else{
				out.write(""+0);
			}
			out.close();			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
	}