bug in difference of angles