Modify with Binary Search template