Using one general function to display keyframes