Added base logic for tables