fixed line 121 so it is greater than or equal allowing for case that largest eigval is first eigval