Added first steps of wave gauge inversion and moved distance computation to batch routine