sequential algorithm complete