working on wait() and setting the secret variable