fixed mistake in calculation
(#248)