Finished JS for submitting results