for loop improved (is workink like C for lop)