fix mathematical bug in compute function
added parameter tuning support for algorithms