add a gradient overlay

adjust autofill algorithm