rm algorithms