search function working, closing issue #3