calculation correction - added back pdf[i]