optimizer alg 1: lines only, no corner merge yet