fixing the findIndexForRow function to put height 0 at the end and always look for previous tx throughly.