Changed depreciated check function call
Fixed the binary search
Linear search is actually faster