-*-pa-*- faster distance calculation