replaced a hard coded value with a calcuation based on a global constant.