slightly cleaner code
got R's stored per keyframe
something fucky is giong on with r=NaN