added fuzzy search to search library, small code formatting and refactoring changes