added data tables, big refactor