steps of our algorithm