clean up algorithms