private int getSyndromeIndex(String recievedi) {
		int[] recieved = new int[7];
		for(int i = 0; i < 7; ++i)
		{
			recieved[i] = recievedi.charAt(i) == '0' ? 0 : 1; 
		}
		
		int[] syndrome = new int[3];
		Arrays.fill(syndrome, 0);
		
		// calc syndrome by z=Hr
		for(int i = 0; i < 3; ++i)
			for(int k = 0; k < 7; ++k)
			{
				syndrome[i] += H[i][k] * recieved[k];  
			}
		
		// convert to index
		int indexSyndrome = 0;
		for (int i = 0 ; i < 3; ++i) {
			syndrome[i] %= 2;
			indexSyndrome += syndrome[i] * (int)Math.pow((double)2, (double)(2 - i));
		}
		
		return indexSyndrome;
	}