algorithm tweaking