Moved JS code to bottom of page