Added some comments, cleaned up a bit, and added optimization to sasa_sum_angles.