private JButton getButton(String text) {
        for (JButton button : controls) {
            String s = button.getText();
            if (text.endsWith(s) ||
                (s.equals("=") &&
                (text.equals("Equals") || text.equals("Enter"))) ) {

                return button;
            }
        }
        return null;
    }