public void set(int key, int val) {
                Node e=map.get(key);
                if (e==null) {
                    if (map.size()==c) {
                        e=head.before;
                        map.remove(e.key);
                        e.key=key;
                        removeFromQueue(e);
                    } else {
                    	e=new Node(key, val);
                    }
                } else 
                	removeFromQueue(e);
                putFirst(e);
                e.val=val;
                map.put(key,e);
            }