added logic for generating secret number