Refactored submit button and added documentation