Finished search algorithm using bigger table