Moved magic numbers to #defines