fix for early submission and blank input
styling and refactoring