minor tweaking to calculations