front end code for election site