Add & change binsearch for templates
Add & change binsearch for templates