minor calculation fix