corretions and some debuging