Creating the proofOfWork method