• I agree - the two functions can be merged easily.

    I intentionally did not mix the two to enable a clear understanding.