Finishing algorithm