change 'magic numbers' to constants