add loop boolean in order to have a loop for the numerator