Added the new way to calculate x-values in outer, presented by Peter