computePath() improvemement