moved JS out to separate file