This is Merlin 
        
        He is google's dumb cousin who can search for movies

        He is a tad slow, so please be patient with him

        He is dumb too, so while telling him about names of the cast or crew, make sure to avoid spelling mistakes

        For example, you are looking for Arnold Schwarzenegger, you just tell him arnold and he will find him

        If you are looking for Anne Hathaway, you just tell him anne, and so on

        If you will misspell a name he won't be able to find the intended person 
        
        So, just follow the instructions and let Merlin weave his spell

def discover(ctx):
    '''
        This is Merlin 
        
        He is google's dumb cousin who can search for movies

        He is a tad slow, so please be patient with him

        He is dumb too, so while telling him about names of the cast or crew, make sure to avoid spelling mistakes

        For example, you are looking for Arnold Schwarzenegger, you just tell him arnold and he will find him

        If you are looking for Anne Hathaway, you just tell him anne, and so on

        If you will misspell a name he won't be able to find the intended person 
        
        So, just follow the instructions and let Merlin weave his spell 
    '''
    if ctx.invoked_subcommand is None:
        click.echo("Hi, I am Merlin, your personal movie recommender\n")
        time.sleep(1)
        click.echo("So,let's find you a Movie\n")

        # Get the Language
        language = 'en'
        wantLanguage = click.confirm('Do you want to pick the language,default is english')
        click.echo('\n')
        if wantLanguage:
            justEN = click.confirm('All languages')
            click.echo('\n')
            if justEN:
               language = '' 

        # Get the Genre
        genre = ''
        wantGenre = click.confirm('Do you want to a pick a genre ')
        click.echo('\n')
        if wantGenre:
            for key in sorted(numToGenre.iterkeys()):
                click.echo(str(key) + '. ' + numToGenre[key].encode('ascii','ignore'))
            g = click.prompt('\nPick a Genre(comma separated)')
            click.echo('\n')
            gList = g.split(',')
            for i in xrange(len(gList)):
                genre += str(genreDict[numToGenre[int(gList[i])]])
                genre += ','
            genre = genre[:-1]

        # Get the year
        year = ''
        wantYear = click.confirm('Do you want to pick a year, only movies after this year will be picked')
        click.echo('\n')
        if wantYear:
            year = click.prompt('Pick a year (YYYY)')
            click.echo('\n')

        # Get the Cast
        cast = ''
        wantCast = click.confirm('Do you want to specify the cast ')
        click.echo('\n')
        if wantCast:
            click.echo('Pick the cast, Be as specific as you can and avoid spelling mistakes\n')
            while True:
                search = tmdb.Search()
                name = click.prompt('Give me a name')
                click.echo('\n')
                result = findPerson(name)
                if (result):
                    for key in sorted(result.iterkeys()):
                        add = click.confirm('Are you looking for ' + key[1].encode('ascii','ignore'))
                        click.echo('\n')
                        if add:
                            cast += str(result[key])
                            cast += ','
                            break;
                else:
                    click.echo('Sorry, try again')
                    click.echo('\n')
                 
                confirm = click.confirm('You want to add more people')
                click.echo('\n')
                if (confirm == False):
                    break
            cast = cast[:-1]

        
        # Get the crew
        crew = ''
        wantCrew = click.confirm('Do you want to specify the crew ')
        click.echo('\n')
        if wantCrew:
            click.echo('Pick the crew, Be as specific as you can and avoid spelling mistakes\n')
            while True:
                search = tmdb.Search()
                name = click.prompt('Give me a name')
                click.echo('\n')

                result = findPerson(name)
                if (result):
                    for key in sorted(result.iterkeys()):
                        add = click.confirm('Are you looking for ' + key[1].encode('ascii','ignore'))
                        click.echo('\n')
                        if add:
                            crew += str(result[key])
                            crew += ','
                            break;
                else:
                    click.echo('Sorry, try again')
                    click.echo('\n')
                 
                confirm = click.confirm('You want to add more people')
                click.echo('\n')
                if (confirm == False):
                    break
            crew = crew[:-1]

        # Get results
        click.echo('Sit back and Relax\n')
        page = 1

        castSearch = cast
        crewSearch = crew
        tPages = 0
        tResults = 0

        while True: 
            if page > 1:
                click.echo('Looking for more results\n')
            movies,tPages,tResults = discoverMovie(genre,castSearch,crewSearch,language,year,page)
            wantQuit = False

            if movies:
                           
                page += 1

                wantQuit = displayMovie(movies,wantQuit) 
                click.echo('\n')
                if wantQuit == False:
                    break
                    
            else:
                if tResults == 0:
                    click.echo('Nothing found\n')
                    break 

                elif page > tPages:
                    click.echo('End of the results\n')
                    break
                else:
                    click.echo('Sorry, try again')
            
            #if wantQuit == False:
            #    break
        click.echo("That's all Folks,Merlin says goodbye\n")