implemented data tables and fixed a lot of bugs