added search
removed unused vars