Update alg3.h

Working alg3. Going to edit the function to accept an int input, which will be used as the number of random tries.