Added Rhid algorithm