Change alerts to DOM manipulation for errors
Refactor showing error on bad input