internalized main fn, added new alert and confirm methods, prettified the index page