writing stats