Creating pi mining algorithm