not quite sure, but replace the method setValue with this, i think it works
public void setValue(int replacementValue){
if(0<=replacementValue&&replacementValue<=limit)
value = replacementValue;
} else if(replacementValue > limit) {
value = replacementValue - 12;
}
}

