Improved path drawing method to avoid overlap.