adding new submit button and some code cleanup