private static int getTableIndex(float[] elem, float threshold)
    {
        int tableIndex = 0;
        if(elem[0] < threshold)
        {
            tableIndex |= 1;
        }
        if(elem[1] < threshold)
        {
            tableIndex |= 2;
        }
        if(elem[2] < threshold)
        {
            tableIndex |= 4;
        }
        if(elem[3] < threshold)
        {
            tableIndex |= 8;
        }
        if(elem[4] < threshold)
        {
            tableIndex |= 16;
        }
        if(elem[5] < threshold)
        {
            tableIndex |= 32;
        }
        if(elem[6] < threshold)
        {
            tableIndex |= 64;
        }
        if(elem[7] < threshold)
        {
            tableIndex |= 128;
        }
        return tableIndex;

    }