add ability for random mode or normal mode