Memory optimization

Program will now only create a random number if the user has first
selected acceptable input