debug calculations