Moved where the base altitude is calculated.