ignore the printf code I do not own
Added better handler for tables file, crashed J though