changed consts to unsigned