Changed linear search to binary for value approximation