modifying code to only record complete chains instead of partials.