fine tuning general algo