Added submission generation function