public String lookup(int value, String type) {
        String result = null;
        Iterator it;
        
        System.out.println("TYPE:" + type);

        // this is where we look up rules defined in our two dimensional matrix,
        // sorted by contextual type (i.e., temperature)
        switch (type) {
            case "temperature": {
                // temperature fuzzy set
                it = tempRules.entrySet().iterator();
                Map.Entry currTempEntry = null;
                Map.Entry prevTempEntry = null;
                // get the first entry
                currTempEntry = (Map.Entry) it.next();
                while (it.hasNext()) {
                    // store the previous entry
                    prevTempEntry = currTempEntry;

                    // get the next entry
                    currTempEntry = (Map.Entry) it.next();

                        // if... then...
                    // very cold vs cold, cold vs warm, etc.
                    // if value is between 0 AND value is between 10
                    // assign it this linguistic type
                    if (value >= (int) prevTempEntry.getKey()
                            && value <= (int) currTempEntry.getKey()) {
                        result = (String) currTempEntry.getValue();
                    }
                }
                break;
            }
            case "movement": {
                // temperature fuzzy set
                it = ultrasonicRules.entrySet().iterator();
                Map.Entry currTempEntry = null;
                Map.Entry prevTempEntry = null;
                // get the first entry
                currTempEntry = (Map.Entry) it.next();
                while (it.hasNext()) {
                    // store the previous entry
                    prevTempEntry = currTempEntry;

                    // get the next entry
                    currTempEntry = (Map.Entry) it.next();

                        // if... then...
                    // away vs present, etc.
                    // if value is between 0 AND value is between 10
                    // assign it this linguistic type
                    if (value >= (int) prevTempEntry.getKey()
                            && value <= (int) currTempEntry.getKey()) {
                        result = (String) currTempEntry.getValue();
                    }
                }
                break;
            }
        }

        return result;
    }