Now writes out secret number after 7 guesses has been made and moved around code for clearer structure