implemented part of table search