Added improved search code
Merge branch 'master' into testing