search function plus a few small things
added search and a few small things