def METHOD_NAME(argv):
    params = iP()
    params.parseArgv(argv)
    Data = HashData('', params.getN(), params.getM())
    sem = initSem(0)
    agregator_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    agregator_socket.connect((params.getAgregatorAddress(), params.getAgregatorPort()))
    agregator_t = threading.Thread(target=agregator_thread, args=(agregator_socket, params, Data, sem,))
    agregator_t.start();
    sem.acquire()
    while True:
        print 'EOC to quit, plot <key>'
        print 'Available keys: {0}'.format(params.keys)
        s = raw_input('> ')
        s = s.rstrip("\n\r")
        if 'EOC' in s:
            params.stop_event.set()
            break
        elif 'plot' in s:
            tmp = s.split(' ')
            keys = splitclean(tmp[1], ';')
            for key in keys:
                t = Thread(target=plot_thread, args=(params, Data, key,))
                t.start()
                gui_threads.append(t)
    agregator_t.join()
    agregator_socket.close()
    for t in gui_threads:
        t.join()