added stat functions