modified input generation logic