why this class_ok ? 
It doesn't seem to be used anywhere, except to skipt the first iteration for apparently no reason