kinda works minus binsearch