randomly choose code