fixed the iteration to fullfill the table