Document the logic behind all these crazy magic numbers?