Added the getNextSubmission function