changed to table driven from and removed requirement for bitarray