Tweaking script to print trace