moved js into a file