I\'m trying to find a way to get rid of this while loop because its costly in time. what I\'m doing here is indexing the list (data) to then find the highest value in betwe