public ArrayList<Byte> getRecord(long snpIndex) throws IOException{
        //have index, now load gen file
		BufferedInputStream genIS;
		ArrayList<Byte> genos = new ArrayList<Byte>();
		
        if (this.isCompressed()){
        	
        	genIS = new BufferedInputStream(new GZIPInputStream(new FileInputStream(file),8192));
        	
        } else{
        	
        	genIS = new BufferedInputStream(new FileInputStream(file),8192);
        	
        }
                
        //skip to SNP of interest
        //sometimes the skip() method doesn't skip as far as you ask, so you have to keep flogging it
        //java sux. 
        long remaining = (snpIndex * bytesPerRecord)+bedHeaderOffset;
        while ((remaining = remaining - genIS.skip(remaining)) > 0){
        }

        //read raw snp data
        byte[] binSnpData = new byte[bytesPerRecord];
        genIS.read(binSnpData, 0, bytesPerRecord);
        // close the input stream
        genIS.close();
        // convert the binary data array into a float array
        float[] floatSnpData = new float[numInds*3];
        int count = 0;
        for (int start = 0; start < bytesPerRecord; start = start + 4) {
        	floatSnpData[count] = arr2float(binSnpData, start);
        	count++;
        }
            
        // loop through each set of three values and then decide on the genotype
        for (int loop = 0; loop < floatSnpData.length; loop = loop + 3) {
        	
        	float aa = floatSnpData[loop];
        	float ab = floatSnpData[loop+1];
        	float bb = floatSnpData[loop+2];
              
        	//convert into array of genotypes
        	//genotype code is:
        	//0 == homo 1
        	//1 == missing
        	//2 == hetero
        	//3 == homo 2
        	if (aa > 0.9) {
        		genos.add((byte)0);
        	} else if (ab >0.9){
        		genos.add((byte)2);
        	} else if (bb > 0.9) {
            	  genos.add((byte)3);
        	} else {
        		genos.add((byte)1);
            }
        }
                   
        return genos;
        
	}