Adjusted the sorting routine to sort using degrees. This is done beause matlab truncates so when using radians you only have 0 - 3.14.... but with degres we have 0 - 360. Less error orcurs from truncating