minor changes to calculations