added tables and functionality