while instead of if d_value less than p_value