Fixed sort scripts. Added search functionality