Working version
The updated metric