New path drawing algorithm (work in progress).