fixing reward computation