adding functionality and tests for table component