fixed spellingerrors
moved JS to separate file