keyframe reading moved into demo function