Add an inertia and use better bash logic.