making it work for hawthor as well -moved js into its own file