fix algo for lyne filling