added cache
added search function