Strand's algorithm