Working implementation with randomization and user input