@Override
    public void run() {
        System.out.println("UserHandler thread started");

        String hours = new SimpleDateFormat("HH").format(Calendar.getInstance().getTime());
        String minutes = new SimpleDateFormat("mm").format(Calendar.getInstance().getTime());
        String seconds = new SimpleDateFormat("ss").format(Calendar.getInstance().getTime());
        String millis = new SimpleDateFormat("SSS").format(Calendar.getInstance().getTime());
        String curTime = hours + "_" + minutes + "_" + seconds + "_" + millis;
        log("Started at: " + curTime);

        log("Starting the main loop");
        while (!terminated) {

            performedOperations++;
            //System.out.println("[com.user.UserHandler]: Gonna send some.");
            int num = random.nextInt(users.size() + 1);
            switch (num) {
                case 0: {
                    if (users.size() < maxUsers) {
                        createOperations++;
                        User user = new User("Peter");
                        users.add(user);

                        BankRequest bankRequest = new BankRequest(user, BankRequest.OPERATION_CREATE_ACCOUNT, 0);
                        bank.makeRequest(bankRequest);
                    }
                    break;
                }
                default: {
                    User user = users.get(num - 1);

                    BankRequest bankRequest;
                    if (num % 2 == 0) {
                        creditOperations++;
                        bankRequest = new BankRequest(user, BankRequest.OPERATION_CREDIT, (num * 100) % 64);
                    } else {
                        depositOperations++;
                        bankRequest = new BankRequest(user, BankRequest.OPERATION_DEPOSIT, (num * 100) % 64);
                    }

                    bank.makeRequest(bankRequest);
                    break;
                }
            }
        }

        hours = new SimpleDateFormat("HH").format(Calendar.getInstance().getTime());
        minutes = new SimpleDateFormat("mm").format(Calendar.getInstance().getTime());
        seconds = new SimpleDateFormat("ss").format(Calendar.getInstance().getTime());
        millis = new SimpleDateFormat("SSS").format(Calendar.getInstance().getTime());
        curTime = hours + "_" + minutes + "_" + seconds + "_" + millis;
        log("Terminated at: " + curTime);

        // Telling the bank that we are done sending requests
        //bank.reportRequestsEnded();

        // Creating a LopPackage for Main
        LogPackage logPackage = new LogPackage(performedOperations, createOperations, creditOperations,
                depositOperations);
        Main.uhAnalytics = logPackage;

        log.nextLine();
        log("Analytics:");
        log("Performed operations", performedOperations);
        log("Create operations", createOperations);
        log("Credit operations", creditOperations);
        log("Deposit operations", depositOperations);
        log.nextLine();
        log("Terminating");

        /*
        System.out.println("[com.user.UserHandler] Performed operations: " + performedOperations);
        System.out.println("[com.user.UserHandler] Create operations: " + createOperations);
        System.out.println("[com.user.UserHandler] Credit operations: " + creditOperations);
        System.out.println("[com.user.UserHandler] Deposit operations: " + depositOperations);
        System.out.println("[com.user.UserHandler] Users size: " + users.size());
        System.out.println("[com.user.UserHandler]: Terminated");
        */

        log.terminate();
        System.out.println("UserHandler thread terminated");
    }