lots of changes and fixes, added search filtering