moved js into separate file