many changes, improve program speed, improve scaling, improve match filtering