debug logging values before calculation