Minor fix(results still not correct as compared with R)