gen err fct added; refactoring tables; ast work - dep analysis needed