added rule database, bugs in encoding classes