Added random functionality.