bug fix in loop management

logical > in lines 24 and 38 have to be the same