Added logic to Generater.