First implementation of dialog