Error in arc angle calculation; trying a potential fix