finished up submit portion of the code