turned some magic numbers into macros