Updated javascript and prepared code for event testing