fix halving calculations