added modal functionality, cleaned up submit button code.