make changes to submit button coding and rearragement of some code