added entropy based distance calculation