fixed the sort bug, added isosceles function and check