minor calculation update for less code