Added submission parsing and cleaned up a bit