add variable and function tables, some small changes