Implement the random selection algo