search for first element greater than k