Removed magic numbers, replaced with #defines.