added stability measuring functions