moved js stuff to the bottom of file