fixed calculation of karma