Indentation
Removed auto-generated return statements
Moved preventSumbit code to the right scope