after testing ... adding code to collect stats