method for giving indexes works alt least
deleted commented code
the main program give correct results (i made only one test) for 2 TVs