Improved elements and event handling, added AJAX.