loop in uint()  simplified