Moved js into it's own file to clean things up