moving js into own file and calling from index