moved map initialization in the right place
optimize multiple call of pathFinding search