getNearestMateWithoutEnemyAround updated for a better functionality