refactored stats to use updated yz API