public static int[][] openMatrixfile(String filename) throws FileNotFoundException {
		
		File inputFile = new File("src" + File.separator + "gol" + File.separator + filename);
		
		if(!inputFile.exists()){			
			return null;			
		}
		Scanner lengthScanner = new Scanner(inputFile);
		int arrayLength =1;
		String linje = lengthScanner.nextLine();
		for (int i=0; i<linje.length(); i++){
			if (linje.charAt(i)==' '){
				arrayLength++;
			}
		}
		lengthScanner.close();
		
		Scanner fileScanner = new Scanner(inputFile);
		int[][] matrixContent = new int[arrayLength][arrayLength];
		
		for (int i=0; i<arrayLength; i++){
			for (int j=0; j<arrayLength; j++){
				matrixContent[i][j]=fileScanner.nextInt();
			}
		}
		
		fileScanner.close();
		
		return matrixContent;
	}