Tidied. Added some test-cases. Comment on (IMO) broken metric.