improved path finding and map drawing