implemented alternate zstats in Python