Added Trails option and JS closure