Now fully compatible with mathematical definition.