Added random algorithm