tweaking the algo