Replaced magic numbers with #define