Error checking and debugging

Warning messages if fields are left blank.
No submission if fields are not filled.
Collapse common codes into methods.