Finishing up algorithms