public RemoteManager(JButton button) {
        this.toiletButton =button;

        SwingUtilities.invokeLater(new Runnable() { //Do we really need this? Invokation is guaranteed from swing.
            public void run() {
                toiletButton.setBackground(new Color(154, 154, 154));
                toiletButton.setFont(new Font("Sans",Font.PLAIN,40));
                toiletButton.setHorizontalAlignment(SwingConstants.LEFT);
                toiletButton.setFocusPainted(false);
                toiletButton.addMouseListener(new MouseListener() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        if(SwingUtilities.isLeftMouseButton(e)) {
                            //System.out.println("LMOUSE");
                            state &= 0b11111011; //Set to manual mode
                            state |= 0b00000010; //Set to manual mode
                            state ^= 0b00000001; //Toggle current display

                        }else if(SwingUtilities.isRightMouseButton(e)){
                            //System.out.println("RMOUSE");
                            state &= 0b11111101; //Auto mode
                            state |= 0b00000100; //uninitialized mode

                        }

                        updateButton();

                    }

                    @Override
                    public void mousePressed(MouseEvent e) {}
                    @Override
                    public void mouseReleased(MouseEvent e) {}
                    @Override
                    public void mouseEntered(MouseEvent e) {}
                    @Override
                    public void mouseExited(MouseEvent e) {}
                });
                updateButton();

            }
        });

        try{
            socket = new DatagramSocket(UDPport);
            socket.setSoTimeout(cycleTime);
        }catch(Exception e){
            state |= 0b00001000;//UDP failure
            System.out.println("Unable to bind port 2302, no remote control function available.");
            updateButton();
        }
        ExecService = Executors.newSingleThreadScheduledExecutor();
        ExecService.scheduleWithFixedDelay(this, 0, cycleTime, TimeUnit.MILLISECONDS);
    }