Finished algorithm, and views