distance between classes and function adapted to PEP-8