tweaked summary code