Add the actual retraction part + tests.