added diagonal distance calculation