Added two methods inside IP algorithm: cluster_update and cluster_remove, to clean up the code a bit.