moved to a table based implementation

to test it